home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 106_01.zip / CRL.DOC < prev    next >
Text File  |  1993-06-26  |  3KB  |  58 lines

  1.                 crl.doc
  2.  
  3.     Copyright (C) 1980, M J Maney
  4.  
  5.     last revised 9/6/80 21:55
  6.  
  7.  
  8.     This file shall attempt to explain the use of the macros defined in
  9.     the "crl.lib" library file.
  10.  
  11.     The purpose of the crl.lib file is to make it less painful to write
  12.     function modules in assembler that can be linked to the code
  13.     generated by the BDS C compiler. There are several reasons for
  14.     wishing to do this, the primary one being the sometimes grossly
  15.     inefficent code sequences that the compiler generates. This is not
  16.     due so much to the compiler's simple-mindedness as to the limited
  17.     capabilities of the 8080 instruction set. A clever programmer can
  18.     produce much more compact code than ANY compiler for the 8080
  19.     (or probably most any of the early microprocessors), and in some
  20.     cases the difference can be simply astounding. Thus, we shall at
  21.     times desire to replace a function originally coded in C with a
  22.     carefully optimized one written in assembler. And thus the driving
  23.     force behind the package herein described.
  24.  
  25.     There is currently one minor nuisance involved in utilizing the
  26.     macros...the hex file is NOT properly loaded by the CP/M load
  27.     utility, so good old ddt's services are required (still). But at
  28.     least all you have to do is use ddt to load the hex file. Once
  29.     the image is in memory, all that is required is to "save" the
  30.     image as a ".crl" file.
  31.  
  32.     For example, to load the functions in strfun.asm into the crl
  33.     format file (named, of course, strfun.crl), the procedure is:
  34.  
  35.     1)    assemble strfun
  36.     2)    use ddt to load the hex file produced. I've been clearing the
  37.     background to zero first, which helped during debugging of the
  38.     crl macros, but isn't really needed.
  39.     3)    note what address ddt reports, this is the top of the memory
  40.     image that must be saved.
  41.     4)    exit ddt, remembering the address
  42.     5)    save the memory image using the built-in "save" utility and
  43.     the address that you (hopefully) remembered. The number of
  44.     "pages" that must be saved are
  45.  
  46.         n = ceiling((address - base of TPA) / 0x100)
  47.  
  48.     where ceiling(x) is the smallest integer equal or larger than x.
  49.     For standard CP/M, this is simply the "100's" digit of the
  50.     address....at least for the sample files I sent.
  51.     6)    That's it
  52.  
  53.     If this sounds like a lot of work, let me reassure you...its
  54.     easier to do than to explain. I could execute the whole sequence
  55.     in far less time than its taken me to write all this, and maybe
  56.     in less time than it takes to read this (unless you're a graduate
  57.     of the Evelyn Wood system).
  58.